import { messages } from "share/common";
import React, { Component } from "react";
import { Popconfirm } from "antd";
import SVGIcon from "components/SVGIcon";
import "styles/home/example-close-tag.scss";

class ExampleTag extends Component {
  constructor(props) {
    super(props);
  }

  componentWillMount() {}

  componentDidMount() {}

  onConfirm = () => {
    const { onConfirm } = this.props;
    onConfirm && onConfirm();
  };

  render() {
    const { show } = this.props;
    return (
      <Popconfirm
        overlayClassName={"example-tag"}
        placement="topRight"
        title={messages("basic-1.key257") /*是否删除示例数据？删除后不可恢复*/}
        arrowPointAtCenter
        onConfirm={this.onConfirm}
      >
        <div className={`example-close-tag ${show ? "show-tag" : "hide-tag"}`}>
          {messages("basic-1.key258") /*示例*/}
          <SVGIcon type={"home-close"} />
        </div>
      </Popconfirm>
    );
  }
}

export default ExampleTag;
